home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / XML.XS_ / xml.xsl
Encoding:
Extensible Markup Language  |  2003-02-21  |  1.7 KB  |  40 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!-- Copyright (c) Microsoft Corporation.  All rights reserved. -->
  4.  
  5. <!-- Generic stylesheet for viewing XML -->
  6. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  7.   <!-- This template will always be executed, even if this stylesheet is not run on the document root -->
  8.   <xsl:template>
  9.     <DIV STYLE="font-family:Courier; font-size:10pt; margin-bottom:2em">
  10.       <!-- Scoped templates are used so they don't interfere with the "kick-off" template. -->
  11.       <xsl:apply-templates select=".">
  12.         <xsl:template><xsl:apply-templates/></xsl:template>
  13.  
  14.         <xsl:template match="*">
  15.           <DIV STYLE="margin-left:1em; color:gray">
  16.             <<xsl:node-name/><xsl:apply-templates select="@*"/>/>
  17.           </DIV>
  18.         </xsl:template>
  19.  
  20.         <xsl:template match="*[node()]">
  21.           <DIV STYLE="margin-left:1em">
  22.             <SPAN STYLE="color:gray"><<xsl:node-name/><xsl:apply-templates select="@*"/>></SPAN><xsl:apply-templates select="node()"/><SPAN STYLE="color:gray"></<xsl:node-name/>></SPAN>
  23.           </DIV>
  24.         </xsl:template>
  25.  
  26.         <xsl:template match="@*">
  27.           <SPAN STYLE="color:navy"> <xsl:node-name/>="<SPAN STYLE="color:black"><xsl:value-of /></SPAN>"</SPAN>
  28.         </xsl:template>
  29.  
  30.         <xsl:template match="pi()">
  31.           <DIV STYLE="margin-left:1em; color:maroon"><?<xsl:node-name/><xsl:apply-templates select="@*"/>?></DIV>
  32.         </xsl:template>
  33.  
  34.         <xsl:template match="cdata()"><pre><![CDATA[<xsl:value-of />]]></pre></xsl:template>
  35.  
  36.         <xsl:template match="textNode()"><xsl:value-of /></xsl:template>
  37.       </xsl:apply-templates>
  38.     </DIV>
  39.   </xsl:template>
  40. </xsl:stylesheet>